package yixaun.tim.service;

import lombok.NonNull;
import yixaun.tim.common.TimException;
import yixaun.tim.config.TimProperties;


import java.util.Map;

/**
 * @author pengshiqing
 * @Date: 2019/6/22
 * @Description:
 */
public interface TimService {


    /** 获取配置 */
    TimProperties getTimProperties();

    TimAccountService getTIMAccountService() ;

    TimOnlineStatusService getTIMOnlineStatusService();

    TimRelationService getTIMRelationService();

    TimChatService getTIMChatService();

    TimGroupService getTimGroupService();

    TimProfileService getTIMProfileService();


    /** 获取UserSig信息 */
    String getUserSig(@NonNull String identifier) throws TimException;

    /**
     * 获取UserSig信息
     * @param identifier 用户id
     * @param second 超时时间 秒
     */
    String getUserSig(@NonNull String identifier,Integer second ) throws TimException;

    /**
     * 通用GET方法
     * @param api           TIM API 地址
     * @param queryParams   API 地址所需参数(不包含公共参数)
     */
    String get(String api, Map<String,String> queryParams) throws TimException;

    /**
     * 通用POST方法
     * @param api           TIM API 地址
     * @param body          API 请求体
     */
    String post(String api,Object body) throws TimException;


}
